Communications 109: Links

The status bar greets the reader when the mouse is moved over the first link. The second link uses a JavaScript call in its address.

Move the Mouse over this Link

Click Me

Discussion

This ninth "hello" recipe uses the links to greet the reader. The first link sets the onMouseOver event. When the mouse passes over the link, the status bar updates not to the document reference, but rather to 'Hello World.'

The second uses a JavaScript HREF, not a document location. Rather than change addresses this JavaScript is executed. If the JavaScript returns any data, this becomes the new page. In this example, alert() does not return any data, so the document content does not change.


<A HREF="#"
  onMouseOver="window.status='Hello World';return true"
  onClick = "return true"
>Move the Mouse over this Link</A>

<A HREF="JavaScript:alert('Hello World')"
>Click Me</A>
Copyright ©2000 by Charles River Media, All Rights Reserved